package com.eshop.constant;

import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonFormat;

@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum IntegerEnum
{
    YES("是", Integer.valueOf(1)), 
    NO("否", Integer.valueOf(0)), 
    REQUEST_TYPE_ADMIN("请求类型-平台端", Integer.valueOf(1)), 
    REQUEST_TYPE_BUSINESS("请求类型-商家端", Integer.valueOf(2)), 
    REQUEST_TYPE_APP("请求类型-C端", Integer.valueOf(3)), 
    ENABLE_STOP("活动预热-关闭", Integer.valueOf(1)), 
    ENABLE_START("活动预热-开启", Integer.valueOf(2)), 
    REGIST("类型-注册", Integer.valueOf(1)), 
    LOGIN("类型-登录", Integer.valueOf(2)), 
    BUYER_COLLECT_PRODUCT("收藏类型-商品", Integer.valueOf(1)), 
    BUYER_COLLECT_SHOPID("收藏类型-店铺", Integer.valueOf(2)), 
    SKU_STYLE_ONE("规格样式-单款式", Integer.valueOf(0)), 
    SKU_STYLE_MORE("规格样式-多款式", Integer.valueOf(1)), 
    HANDLE_HAVE("店铺认证状态-已处理", Integer.valueOf(1)), 
    NOT_CERTIFIED("店铺认证状态-未认证", Integer.valueOf(1)), 
    UNDER_REVIEW("店铺认证状态-审核中", Integer.valueOf(2)), 
    APPROVED("店铺认证状态-审核通过", Integer.valueOf(3)), 
    AUDIT_FAILURE("店铺认证状态-审核失败", Integer.valueOf(4)), 
    SIGN_SUCCESS("店铺认证状态-签约成功", Integer.valueOf(5)), 
    UNTREATED("入驻状态-未处理", Integer.valueOf(0)), 
    ADOPT("入驻状态-通过", Integer.valueOf(1)), 
    REFUSE("入驻状态-拒绝", Integer.valueOf(2)), 
    CANVAS_ACTIVITY_GROUP_WORK("画布活动类型条件-拼团", Integer.valueOf(1)), 
    CANVAS_ACTIVITY_SECKILL("画布活动类型条件-秒杀", Integer.valueOf(2)), 
    CANVAS_ACTIVITY_DISCOUNT("画布活动类型条件-限时折扣", Integer.valueOf(3)), 
    PERSONAL("主体类型-个人", Integer.valueOf(1)), 
    INDIVIDUAL("主体类型-个体工商户", Integer.valueOf(2)), 
    ENTERPRICE("主体类型-企业", Integer.valueOf(3)), 
    ORGANIZATION("主体类型-其他组织", Integer.valueOf(4)), 
    AFTER_STAY("售后状态-审核中", Integer.valueOf(1)), 
    AFTER_REFUND_STAY("售后状态-退款中", Integer.valueOf(2)), 
    AFTER_RETURN_STAY("售后状态-退货中", Integer.valueOf(3)), 
    AFTER_REFUND_SUCCESS("售后状态-退款成功", Integer.valueOf(4)), 
    AFTER_REFUND_ERRPR("售后状态-退款失败", Integer.valueOf(5)), 
    AFTER_STAY_NO("售后状态-审核不通过", Integer.valueOf(6)), 
    AFTER_PLATFORM_STAY("售后状态-评审中", Integer.valueOf(7)), 
    AFTER_RETURN_SUCCESS_NOT_REFUND("售后状态-退货完成，拒绝退款", Integer.valueOf(8)), 
    AFTER_CANCEL("售后状态-已关闭", Integer.valueOf(9)), 
    AFTER_STAY_YES("售后状态-审核通过", Integer.valueOf(10)), 
    AFTER_REFUND("售后类型-仅退款", Integer.valueOf(1)), 
    AFTER_REFUND_DILEVERY("售后类型-退货退款", Integer.valueOf(2)), 
    ORDER_STAY_PAY("订单状态-待付款", Integer.valueOf(1)), 
    ORDER_STAY_DILEVERY("订单状态-待发货", Integer.valueOf(2)), 
    ORDER_HAVE_DILEVERY("订单状态-待收货", Integer.valueOf(3)), 
    ORDER_FINISH("订单状态-已完成", Integer.valueOf(4)), 
    ORDER_STOP("订单状态-已取消", Integer.valueOf(5)), 
    ORDER_STAY_COLLAGE("订单状态-待成团", Integer.valueOf(6)), 
    ORDER_PAY_SUCCESS("订单支付状态-已支付", Integer.valueOf(1)), 
    ORDER_PAY_STAY("订单支付状态-待支付", Integer.valueOf(0)), 
    ORDER_PAY_WX("订单支付方式-微信", Integer.valueOf(1)), 
    ORDER_PAY_ALI("订单支付方式-支付宝", Integer.valueOf(2)), 
    ORDER_PAY_HUABEI("订单支付方式-花呗分期", Integer.valueOf(3)), 
    ORDER_SUB_PAYMENT_MODE_XCX("微信具体支付方式-小程序", Integer.valueOf(1)), 
    ORDER_SUB_PAYMENT_MODE_APP("微信具体支付方式-APP支付", Integer.valueOf(2)), 
    ORDER_SUB_PAYMENT_MODE_H5("微信具体支付方式-H5支付", Integer.valueOf(3)), 
    DISTRIBUTOR_STAY("分销员审核状态-待处理", Integer.valueOf(0)), 
    DISTRIBUTOR_SUCCESS("分销员审核状态-审核通过", Integer.valueOf(1)), 
    DISTRIBUTOR_ERROR("分销员审核状态-审核不通过", Integer.valueOf(2)), 
    DIRECT_DISTRIBUTION_MONEY("分销员等级升级规则-累计直接分销金额", Integer.valueOf(1)), 
    INVITE_SUBORDINATES("分销员等级升级规则-邀请下级满", Integer.valueOf(2)), 
    FULL_CUSTOMERS("分销员等级升级规则-客户满", Integer.valueOf(3)), 
    TOOL_NOT_START("营销工具状态-未开始", Integer.valueOf(0)), 
    TOOL_HAND("营销工具状态-进行中", Integer.valueOf(1)), 
    TOOL_END("营销工具状态-已结束", Integer.valueOf(2)), 
    DAY_CONDITION("日汇总条件", Integer.valueOf(1)), 
    MONTH_CONDITION("月汇总条件", Integer.valueOf(2)), 
    WITHDRAWAL_STAY("提现申请状态-待处理", Integer.valueOf(0)), 
    WITHDRAWAL_ALREADY("提现申请状态-已处理", Integer.valueOf(1)), 
    WITHDRAWAL_SUCCESS("用户提现处理状态-同意", Integer.valueOf(1)), 
    WITHDRAWAL_ERROR("用户提现处理状态-拒绝", Integer.valueOf(2)), 
    BOND_NOT_PAY("保证金状态-未支付", Integer.valueOf(0)), 
    BOND_PAY("保证金状态-冻结中", Integer.valueOf(1)), 
    BOND_REFUND("保证金状态-已退回", Integer.valueOf(2)), 
    BOND_PAY_WEIXIN("保证金支付方式-微信", Integer.valueOf(1)), 
    BOND_PAY_ALIPAY("保证金支付方式-支付宝", Integer.valueOf(2)), 
    SIGN_ACTIVITY_STAY("报名审核状态-待审核", Integer.valueOf(0)), 
    SIGN_ACTIVITY_SUCCESS("报名审核状态-报名成功", Integer.valueOf(1)), 
    SIGN_ACTIVITY_ERROR("报名审核状态-报名失败", Integer.valueOf(2)), 
    SIGN_ACTIVITY_ING("报名审核状态-报名进心中", Integer.valueOf(3)), 
    SHOP_CHECK_SUCCESS("入驻处理状态-同意", Integer.valueOf(1)), 
    SHOP_CHECK_ERROR("入驻处理状态-拒绝", Integer.valueOf(0)), 
    ACTIVITY_NOT_START("营销活动状态-报名未开始", Integer.valueOf(0)), 
    ACTIVITY_SIGN_ON("营销活动状态-报名进行中", Integer.valueOf(1)), 
    ACTIVITY_STAY_START("营销活动状态-活动待开始", Integer.valueOf(2)), 
    ACTIVITY_START("营销活动状态-活动进行中", Integer.valueOf(3)), 
    ACTIVITY_END("营销活动状态-活动已结束", Integer.valueOf(4)), 
    SIGN_STAY("商家活动操作-立即报名（高亮）", Integer.valueOf(1)), 
    SIGN_STAY_NOT("商家活动操作-立即报名（置灰）", Integer.valueOf(2)), 
    SIGN_ALREADY("商家活动操作-报名详情", Integer.valueOf(3)), 
    SIGN_AGAIN("商家活动操作-重新报名", Integer.valueOf(4)), 
    SIGN_CONTINUE("商家活动操作-继续报名", Integer.valueOf(5)), 
    AFTER_ADMIN_SUCCESS("平台介入售后状态-同意", Integer.valueOf(1)), 
    AFTER_ADMIN_ERROR("平台介入售后状态-拒绝", Integer.valueOf(2)), 
    EXPRESS_100("物流查询策略-快递100", Integer.valueOf(1)), 
    EXPRESS_NIAO("物流查询策略-快递鸟", Integer.valueOf(2)), 
    MESSAGE_SUCCESS("短信发送状态-成功", Integer.valueOf(1)), 
    MESSAGE_ERROR("短信发送状态-失败", Integer.valueOf(2)), 
    DIRECT_TYPE("佣金类型-直接", Integer.valueOf(1)), 
    IN_DIRECT_TYPE("佣金类型-间接", Integer.valueOf(2)), 
    RELATIONSHIP_FROZEN("对账单-冻结", Integer.valueOf(1)), 
    RELATIONSHIP_SOLVE_FROZEN("对账单-解冻", Integer.valueOf(2)), 
    RELATIONSHIP_INCOME("对账单-收入(付款)", Integer.valueOf(1)), 
    RELATIONSHIP_ONCOME("对账单-支出(退款)", Integer.valueOf(2)), 
    BUYER_WITHDRAWAL_STAY("客户提现申请状态-审核中", Integer.valueOf(0)), 
    BUYER_WITHDRAWAL_SUCCESS("客户提现申请状态-通过", Integer.valueOf(1)), 
    BUYER_WITHDRAWAL_ERROR("客户提现申请状态-拒绝", Integer.valueOf(2)), 
    SENSITIVE_STOP("敏感词发布状态-禁止发布", Integer.valueOf(1)), 
    SENSITIVE_APPROVE("敏感词发布状态-需审核", Integer.valueOf(2)), 
    CONDITION_TODAY("日期条件-今日", Integer.valueOf(1)), 
    CONDITION_YESTERDAY("日期条件-昨日", Integer.valueOf(2)), 
    CONDITION_WEEK("日期条件-近7天", Integer.valueOf(3)), 
    CONDITION_THIRD("日期条件-近30天", Integer.valueOf(4)), 
    CLASSIFY_LEVEL_ONE("分类级别-一级", Integer.valueOf(1)), 
    CLASSIFY_LEVEL_TWO("分类级别-二级", Integer.valueOf(2)), 
    CLASSIFY_LEVEL_THREE("分类级别-三级", Integer.valueOf(3)), 
    SOURCE_TYPE_IMAGE("素材类型-图片", Integer.valueOf(1)), 
    SOURCE_TYPE_VIDEO("素材类型-视频", Integer.valueOf(2)), 
    COUPON_HAVE("优惠券状态-已领取", Integer.valueOf(0)), 
    COUPON_USE("优惠券状态-已使用", Integer.valueOf(1)), 
    COUPON_OVERDUE("优惠券状态-已过期", Integer.valueOf(2)), 
    COUPON_NOT_HAVE("优惠券状态-未领取", Integer.valueOf(3)), 
    COUPON_RECEIVE_TYPE_INFINITE("优惠券限制状态-无限制领取", Integer.valueOf(1)), 
    COUPON_RECEIVE_TYPE_LIMITED("优惠券限制状态-有限领取", Integer.valueOf(2)), 
    SOURCE_IMAGE("素材类型-图片", Integer.valueOf(1)), 
    SOURCE_REDIO("素材类型-视频", Integer.valueOf(2)), 
    CAN_GRAB_USER("抢客条件-随时可抢", Integer.valueOf(1)), 
    NOT_GRAB_USER("抢客条件-不允许抢客", Integer.valueOf(2)), 
    DAY_GRAB_USER("抢客条件-保护期内允许抢客", Integer.valueOf(3)), 
    APPLY_TYPE_ALL("优惠券-适用商品-全部", Integer.valueOf(1)), 
    APPLY_TYPE_YES("优惠券-适用商品-指定可用", Integer.valueOf(2)), 
    APPLY_TYPE_NO("优惠券-适用商品-指定不可用", Integer.valueOf(3)), 
    TIME_TYPE_FIXED("优惠券-用券时间-固定时间", Integer.valueOf(1)), 
    COUPON_TYPE_REDUTION("优惠券类型-满减", Integer.valueOf(1)), 
    COUPON_TYPE_DISCOUNT("优惠券类型-折扣", Integer.valueOf(2)), 
    TIME_TYPE_CHANGE("优惠券-用券时间-领券当日起几天有效", Integer.valueOf(2)), 
    COUPON_STATE_READY("运营工具-状态-未开始", Integer.valueOf(0)), 
    COUPON_STATE_START("运营工具-状态-进行中", Integer.valueOf(1)), 
    COUPON_STATE_END("运营工具-状态-已结束", Integer.valueOf(2)), 
    GROUP_CONDITION_STOCK("商品分组-智能添加-库存条件", Integer.valueOf(1)), 
    GROUP_CONDITION_PRICE("商品分组-智能添加-价格条件", Integer.valueOf(2)), 
    GROUP_CONDITION_WEIGHT("商品分组-智能添加-重量条件", Integer.valueOf(3)), 
    GROUP_CONDITION_SALES("商品分组-智能添加-销量条件", Integer.valueOf(4)), 
    GROUP_CONDITION_GREATER("商品分组-运算符-大于", Integer.valueOf(1)), 
    GROUP_CONDITION_EQUAL("商品分组-运算符-等于", Integer.valueOf(2)), 
    GROUP_CONDITION_LESS("商品分组-运算符-小于", Integer.valueOf(3)), 
    GROUP_CONDITION_ALL("商品分组-筛选条件-全部满足", Integer.valueOf(1)), 
    GROUP_CONDITION_ONE("商品分组-筛选条件-任意满足", Integer.valueOf(2)), 
    OPERATE_PLAN_MODE_AUTOMATIC("运营计划方式-自动长期计划", Integer.valueOf(1)), 
    OPERATE_PLAN_MODE_MANUAL("运营计划方式-手动定时计划", Integer.valueOf(2)), 
    NOTICE_TYPE_SYSTEM("消息类型-系统消息", Integer.valueOf(1)), 
    NOTICE_TYPE_NOTICE("消息类型-公告", Integer.valueOf(2)), 
    NOTICE_JUMP_ORDER("消息跳转类型-订单", Integer.valueOf(2)), 
    NOTICE_JUMP_PRODUCT("消息跳转类型-商品", Integer.valueOf(1)), 
    PRODUCT_IF_LIMIT_NO("商品是否限购-不限购", Integer.valueOf(1)), 
    PRODUCT_IF_LIMIT_YES("商品是否限购-限购", Integer.valueOf(2)), 
    GROUP_WORK_LAUNCH("拼团活动-发起拼团", Integer.valueOf(1)), 
    GROUP_WORK_JOIN("拼团活动-参与拼团", Integer.valueOf(2)), 
    SECKILL_SUBMIT("秒杀活动-下单", Integer.valueOf(3)), 
    DISCOUNT_SUBMIT("限时折扣活动-下单", Integer.valueOf(4)), 
    COLLAGE_STATE_STAY("拼单状态-待成团", Integer.valueOf(0)), 
    COLLAGE_STATE_SUCCESS("拼单状态-拼团成功", Integer.valueOf(1)), 
    COLLAGE_STATE_ERROR("拼单状态-拼团失败", Integer.valueOf(2)), 
    NORMAL_PRODUCT("商品详情所属-正常商品", Integer.valueOf(0)), 
    GROUP_PRODUCT("商品详情所属-拼团活动商品", Integer.valueOf(1)), 
    SECKILL_PRODUCT("商品详情所属-秒杀活动商品", Integer.valueOf(2)), 
    DISCOUNT_PRODUCT("商品详情所属-限时折扣活动商品", Integer.valueOf(3)), 
    PLATFORM_AFTER_STAY("平台售后处理状态-未处理", Integer.valueOf(0)), 
    PLATFORM_AFTER_SUCCESS("平台售后处理状态-同意", Integer.valueOf(1)), 
    PLATFORM_AFTER_ERROR("平台售后处理状态-拒绝", Integer.valueOf(2));
    
    String name;
    Integer code;
    private static Map<String, IntegerEnum> valueMap;
    
    private IntegerEnum(final String name, final Integer code) {
        this.code = code;
        this.name = name;
    }
    
    public static Integer getByName(final String name) {
        final IntegerEnum result = IntegerEnum.valueMap.get(name);
        if (result == null) {
            throw new IllegalArgumentException("No element matches " + name);
        }
        return result.code;
    }
    
    public String getName() {
        return this.name;
    }
    
    public Integer getCode() {
        return this.code;
    }
    
    static {
        IntegerEnum.valueMap = new HashMap<String, IntegerEnum>();
        for (final IntegerEnum gender : values()) {
            IntegerEnum.valueMap.put(gender.name, gender);
        }
    }
}
